/*
 * author      : 吴中勤 
 * date        : 2018/8/11
 * description : TODO
 */

package com.deepexi.adapter.log;

import java.util.Date;

public class Log4Request extends LogContext {

    /** 发起方 */
    protected String fromSide;
    /** 接收方 */
    protected String toSide;
    /** api类型, 可以据此分类 */
    protected String apiType;
    /** 请求reqId */
    protected String reqId = "";
    /** 请求url */
    protected String url = "";
    /** 请求体 */
    protected String request;
    /** 响应细节 */
    protected String response = "";
    /** 错误详情 */
    protected String errorStr = "";
    /** 耗时 */
    protected Long timeCost = 0L;

    protected int id;
    /** 创建日期 */
    protected final Date createdAt = new Date();

    // ============= setter & getter =============

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public String getFromSide() {
        return fromSide;
    }

    public Log4Request setFromSide(String fromSide) {
        this.fromSide = fromSide;
        return this;
    }

    public String getToSide() {
        return toSide;
    }

    public Log4Request setToSide(String toSide) {
        this.toSide = toSide;
        return this;
    }

    public String getApiType() {
        return apiType;
    }

    public Log4Request setApiType(String apiType) {
        this.apiType = apiType;
        return this;
    }

    public String getReqId() {
        return reqId;
    }

    public Log4Request setReqId(String reqId) {
        this.reqId = reqId;
        return this;
    }

    public String getUrl() {
        return url;
    }

    public Log4Request setUrl(String url) {
        this.url = url;
        return this;
    }

    public String getRequest() {
        return request;
    }

    public Log4Request setRequest(String request) {
        this.request = request;
        return this;
    }

    public String getResponse() {
        return response;
    }

    public Log4Request setResponse(String response) {
        this.response = response;
        return this;
    }

    public String getErrorStr() {
        return errorStr;
    }

    public Log4Request setErrorStr(String errorStr) {
        this.errorStr = errorStr;
        return this;
    }

    public Long getTimeCost() {
        return timeCost;
    }

    public Log4Request setTimeCost(Long timeCost) {
        this.timeCost = timeCost;
        return this;
    }
}
